import Vue from 'vue';
import { Tabbar, TabbarItem, Search, Card } from 'vant';
import { Swipe, SwipeItem, Stepper,Button } from 'vant';
import { Row, Col, Cell, CellGroup, SubmitBar, Checkbox, CheckboxGroup } from 'vant';
import { Tab, Tabs } from 'vant';
Vue.use(Swipe).use(SwipeItem).use(Tabbar).use(TabbarItem)
    .use(Row).use(Col).use(Search).use(Cell).use(CellGroup)
    .use(SubmitBar).use(Checkbox).use(CheckboxGroup).use(Card).use(Stepper).use(Button).use(Tab).use(Tabs);
import App from './App.vue';
import router from './router/';
import store from './store';
import config from './env/config';
import * as filters from './filters/'
import * as validate from './utils/validate';
import { Lazyload } from 'vant';
import './directive/';
import '../node_modules/bootstrap/dist/css/bootstrap.min.css';
// import Vant from 'vant'
// import 'vant/lib/index.css'
import { loadStyle, imgDetail } from './utils/utils'
import './permission';
Vue.use(Lazyload, {
    error: '/img/loading.jpg',
    loading: '/img/loading.jpg'
});
//引入全局css
import './assets/css/style.css';
import './assets/fonts/iconfont.css';
//定义全局价格过滤器
import { currency } from './filters/currency';
Vue.filter('currency', currency)
    // Vue.use(Vant)
Vue.config.productionTip = false;
Vue.prototype.$validate = {};
Vue.prototype.$imgDetail = imgDetail;

Object.keys(filters).forEach((key) => {
    Vue.filter(key, filters[key])
});

Object.keys(validate).forEach((key) => {
    Vue.prototype.$validate[key] = validate[key]
});

Object.keys(config).forEach((key) => {
    Vue.prototype[key] = config[key]
});

config.iconfontVersion.forEach(ele => {
    loadStyle(config.iconfontUrl.replace('$key', ele))
});

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')